package CModel

import (
	"database/sql/driver"
	"errors"
	"github.com/spf13/cast"
	"strings"
)

type MyOperator string

func (s MyOperator) Value() (driver.Value, error) {
	return s, nil
}
func (s *MyOperator) Scan(v interface{}) error {

	value, ok := v.([]byte)
	if ok {
		//*s = MyOperator(services.Operator_name[value])
		if ok := strings.Compare(cast.ToString(value), "1"); ok == 0 {
			//	*s = MyOperator{OpName: "测试"}
		} else {
			//	//*s = "测试"
		}
		*s = "测试"
		return nil
	}

	return errors.New("不匹配的数据类型")
}
